from direct.showbase.ShowBase import ShowBase
from direct.showbase.DirectObject import DirectObject

class MyApp(ShowBase):

    def __init__(self):
        ShowBase.__init__(self)

        # Load the environment model.
        self.scene = self.loader.loadModel("models/panda")
        # Reparent the model to render.
        self.scene.reparentTo(self.render)
        # Apply scale and position transforms on the model.
        self.scene.setScale(1, 0.25, 0.25)
        self.scene.setPos(-8, 42, 0)
        dir(self.scene)

def clickFunc():
    # app.scene.setX(app.scene.getX()+1)
    app.scene.setY(app.scene.getY()+1)

def keyFunc():
    app.userExit()
    
class MyEventHandler(DirectObject):
    def __init__(self):
        pass

event_handler = MyEventHandler()
event_handler.accept("mouse1", clickFunc)
event_handler.accept("escape", keyFunc)

app = MyApp()
app.run()
